import request from '@/api/request'

export const getBusinesses = (params) => request.get('/business/list', { params })
export const getBusiness = (id) => request.get(`/business/${id}`)
export const addBusiness = (data) => request.post('/business', data)
export const updateBusiness = (data) => request.put('/business', data)
export const deleteBusiness = (id) => request.delete(`/business/${id}`)
export const importBusinesses = (file) => {
  const formData = new FormData()
  formData.append('file', file)
  return request.post('/business/import', formData, { headers: { 'Content-Type': 'multipart/form-data' } })
}
export const exportBusinesses = () => request.get('/business/export', { responseType: 'blob' }) 